# Contributor: Duane Hughes <duanejevon@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=logcheck
pkgver=1.3.20
pkgrel=1
pkgdesc="Bash scripts used to monitor system log files for anomalies"
options="!check" # Requires writing to root owned paths but can't run as root
url="http://packages.debian.org/source/sid/logcheck"
arch="noarch"
license="GPL-2.0-or-later"
depends="lockfile-progs"
install="$pkgname.pre-install"
subpackages="$pkgname-doc"
pkgusers="logcheck"
source="http://ftp.debian.org/debian/pool/main/l/logcheck/${pkgname}_$pkgver.tar.xz
	logcheck.cron.d"

builddir="$srcdir"/$pkgname

build() {
	cd "$builddir"
	return 0
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
	mkdir -p "$pkgdir"/var/lib/$pkgname
	mkdir -p "$pkgdir"/var/lock/$pkgname
	install -D -m 644 "$srcdir"/logcheck.cron.d "$pkgdir"/etc/logcheck/logcheck.cron.sample
	install -d "$pkgdir"/usr/share/man
	cp -a "$builddir"/docs/* "$pkgdir"/usr/share/man

	chown -R $pkgusers "$pkgdir"/etc/logcheck "$pkgdir"/var/lock/logcheck "$pkgdir"/var/lib/logcheck
}

sha512sums="deeee10c62f74c44a26e579cf0f11022d92917269dcad0fee27ab92a618746dc7ef76255fa96e0bf60ae0cd5fa2be758937f9b2807a5a179942701f58dead758  logcheck_1.3.20.tar.xz
a177388f18c220323eea6f5413f76873e6ad2a2334f58a05727c7b94a793fcb98bd605cefc6fe44aca6afe5c50a9ef851abcc439aefe5b7545d5d6bb584c0a8b  logcheck.cron.d"
